<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link rel="stylesheet" type="text/css" href="css/add.css"/>
    <script type="text/javascript" src="js/jquery.1.9.1.js" ></script>
    <script type="text/javascript" src="js/layer.js" ></script>
    <link rel="stylesheet" type="text/css" href="css/layer.css"/>
    <script type="text/javascript" src="js/iScroll.js" ></script>
    <script type="text/javascript" src="js/Mdate.js" ></script>
	<link rel="stylesheet" href="css/Mdate.css" />
	<script type="text/javascript" src="js/rem.js" ></script>
    <title>选择产品</title>
</head>
<style>
	.productinfo{margin: 0 0 0.2rem 0;}
	.infop2{font-size: 0.28rem;margin: 0.1rem 0;}
	.num{font-size: 0.2rem;}
</style>
<body>
<form id="form2" action="" enctype="multipart/form-data"  method="post">
<ul class="productinfo">
	<li>
		<div class="infoleft"><img src="img/product.png"/></div>
		<div class="inforight">
			<p>小学生绘本课堂  年级阅读  二年级</p>
			<p class="infop2">CP001</p>
			<p class="infop3">库存:100</p>
		</div>
	</li>
</ul>
<ul class="order_money" style="padding: 0 0.3rem;background: #fff;">
	<li>
    		<span class="chang">仓库名称</span>
    		<span class="jt"></span>
    		<select class="session">
    			<option value="0">必填</option>
    			<option value="111">仓库1</option>
    			<option value="2222">仓库2</option>
    			<option value="3333">仓库3</option>
    		</select>
    </li>
    <li>
    		<span class="address">数量</span>
    		<input type="number" id="address" placeholder="请输入数量"></input>
    </li>
    <li>
    		<span class="num">采购单价</span>
    		<input type="number" disabled="disabled" id="week" value="0.00"></input>
    </li>
    
</ul>
<div class="button">
		<a href="#"><div class="close">删除</div></a>
		<div class="continue"><input class="pay" type="submit" name="" id="" value="保存" /></div>
</div>

</form>
<script>//提交表单
$(function(){
	$('.pay').click(function(){
		var store = $('.session').val();
		var num = $('#address').val();
		var money = $('#week').val();
		if(store == 0){
				layer.open({
				content:'请选择仓库' ,
				skin: 'msg',
				time: 2 //2秒后自动关闭
			});
			return false
		}
		if(num == ''||num == null){
				layer.open({
				content:'数量不能为空' ,
				skin: 'msg',
				time: 2 //2秒后自动关闭
			});
			return false
		}
		if(money == ''||money == null){
				layer.open({
				content:'采购单价不能为空' ,
				skin: 'msg',
				time: 2 //2秒后自动关闭
			});
			return false
		}
		$.ajax({
		  type: 'post',
		  url:"" ,
		  data:{num:num,store:store,money:money},
		  dataType: "json",
		  success: function(data){
		    window.location.href = "product_list.html";
		      }
		 });
	 });
});
</script>
<script>//字体变化
	$('#week').keyup(function(){
		var week = $('#week').val();
		if(week != ''){
			$('.num').css('font-size','0.2rem');
		}else{
			$('.num').css('font-size','0.28rem');
		}
	});
	$('.session').change(function(){
		var session = $('.session').val();
		if(session != 0){
			$('.chang').css('font-size','0.2rem');
			$('.num').css('font-size','0.2rem');
		}else{
			$('.chang').css('font-size','0.28rem');
			$('.num').css('font-size','0.28rem');
		}
	});
	$('#address').keyup(function(){
		var address = $('#address').val();
		if(address != ''){
			$('.address').css('font-size','0.2rem');
		}else{
			$('.address').css('font-size','0.28rem');
		}
	});
</script>

</body>
</html>
